CXX = g++
CXXFLAGS = -std=c++14 -Wall -Wextra -g
SRCDIR = .
BUILDDIR = ../build

# 源文件
SOURCES = cty_dat_parser.cpp test_cty_parser.cpp
OBJECTS = $(SOURCES:.cpp=.o)
TARGET = $(BUILDDIR)/test_cty_parser

# 头文件
HEADERS = cty_dat_parser.h

.PHONY: all clean

all: $(TARGET)

$(TARGET): $(OBJECTS)
	@mkdir -p $(BUILDDIR)
	$(CXX) $(OBJECTS) -o $@

%.o: %.cpp $(HEADERS)
	$(CXX) $(CXXFLAGS) -c $< -o $@

clean:
	rm -f $(OBJECTS) $(TARGET)